use newton's method to find all roots of the equation